﻿@{
    ViewBag.Title = "URL地址管理";
    string Area = ViewBag.Area as string;
}

@model Dictionary<string, Mozlite.Common.Route>

<div class="box">
    <label>应用程序区域</label>
    <div class="right">
        @Html.DropdownListForArea(model => Area, new { onchange = "location.href = '?area='+this.value;" })
        <div class="summary">选择网站所安装的应用程序区域，请慎重修改，否则可能造成错误！一旦出现错误，可能需要重新安装路径脚本...</div>
    </div>
</div>

@if (Model != null)
{
<div class="box">
    <h3>URL路由地址列表</h3>

    <table cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <td class="w150">唯一键</td>
                <td>URL地址</td>
                <td>默认约束</td>
                <td>正则表达式约束</td>
                <td class="action">操作</td>
            </tr>
        </thead>
        <tbody class="hoverline">
        @foreach (var route in Model.Values)
        { 
            <tr>
                <td class="w150">@route.Key</td>
                <td>@route.Url</td>
                <td>@route.Defaults</td>
                <td>@route.Constraints</td>
                <td class="action"><a href="javascript:void(0);" onclick="return openModal('@CUrls.DialogUrlView?id=@route.RouteID',550);">编辑</a></td>
            </tr>
        }
        </tbody>
    </table>
</div>
}

<div class="box">
    <button onclick="return openModal('@CUrls.DialogUrlView?area=@Area',550);">添加URL地址约束</button>
</div>